﻿@model  jianvgroup.com.Models.CompanyNewsModels.NewsModel
@{ var isSysId = (Model.SysId > 0) ? "编辑" : "新增"; }
@section Heads {
    <link rel="stylesheet" type="text/css" href="~/lib/css/plugins/select2/select2.css" />
}
<div class="page-content-wrapper">
    <div class="page-content">
        <!-- BEGIN SAMPLE PORTLET CONFIGURATION MODAL FORM-->
        <!-- END SAMPLE PORTLET CONFIGURATION MODAL FORM-->
        <!-- BEGIN STYLE CUSTOMIZER -->
        <!--#include file="theme-color.html"-->
        <!-- END STYLE CUSTOMIZER -->
        <!-- BEGIN PAGE HEADER-->
        <div class="page-bar">
            <ul class="page-breadcrumb">
                <li>
                    <i class="fa fa-home"></i>
                    <a href="/home">首页</a>
                    <i class="fa fa-angle-right"></i>
                </li>
                <li>
                    <a href="/CompanyNews/Create">新闻公告</a>
                </li>
            </ul>
        </div>
        <h4 class="page-title">
            新闻公告 <small>@isSysId</small>
        </h4>
        <!-- END PAGE HEADER-->
        <!-- BEGIN DASHBOARD STATS -->
        <div class="row">
            <div class="col-md-12">
                <!-- BEGIN VALIDATION STATES-->
                <div class="portlet box blue">
                    <div class="portlet-title">
                        <div class="caption"><en>@isSysId</en>新闻公告</div>
                        @*<div class="tools">
                                <a href="javascript:;" class="collapse">
                                </a>
                            </div>*@
                    </div>
                    <div class="portlet-body form">
                        <!-- BEGIN FORM-->
                        <form action="/CompanyNews/SaveAsync" enctype="multipart/form-data" method="POST" id="formnewscreate" class="form-horizontal">
                            <div class="form-body">
                                @Html.AntiForgeryToken()
                                @Html.ValidationSummary()
                                <div class="alert alert-danger display-hide">
                                    <button class="close" data-close="alert"></button>
                                    出现一些错误。请检查一下。
                                </div>
                                <div class="alert alert-success display-hide">
                                    <button class="close" data-close="alert"></button>
                                    你的表单验证成功!
                                </div>

                                <input type="hidden" value="@Model.SysId" id="SysId" name="SysId" />


                                <div class="form-group">
                                    <label class="control-label col-md-3">
                                        新闻标题 <span class="required">* </span>
                                    </label>
                                    <div class="col-md-6">
                                        @Html.TextBoxFor(x => x.TitleName, new { @class = "form-control", maxlength = "50" })
                                        @*<span class="help-block">请输入用户名 </span>*@
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="control-label col-md-3">
                                        内容 <span class="required">* </span>
                                    </label>
                                    <div class="col-md-4">
                                       @Html.TextAreaFor(x=>x.Content,new { @class = "form-control",@style = "margin: 0px - 245.712px 0px 0px; width: 610px; height: 141px; " })
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="control-label col-md-3">
                                       备注 <span class="required">* </span>
                                    </label>
                                    <div class="col-md-4">
                                        @Html.TextAreaFor(x=>x.Remark,new { @class = "form-control", @style = "margin: 0px -244.705px 0px 0px; height: 123px; width: 610px;",maxlength = "50" })
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="control-label col-md-3">
                                        状态 <span class="required">* </span>
                                    </label>
                                    <div class="col-md-4">
                                        @Html.DropDownListFor(x => x.Status, ViewBag.Status as IList<SelectListItem>, new { @class = "form-control", @id = "Status", @name = "Status" })
                                    </div>
                                </div>
                            </div>

                            <div class="form-actions">
                                <div class="row">
                                    <div class="col-md-offset-3 col-md-9">
                                        <button type="button" class="btn green" id="btnSave">提交</button>
                                        <button type="button" onclick="location.href='/CompanyNews/index'" class="btn default">取消</button>
                                    </div>
                                </div>
                            </div>
                        </form>
                        <!-- END FORM-->
                    </div>
                </div>
                <!-- END VALIDATION STATES-->
            </div>
        </div>
        <!-- END DASHBOARD STATS -->
    </div>
</div>
@section Scripts {
    <script type="text/javascript" src="~/lib/css/plugins/jquery-validation/js/jquery.validate.min.js"></script>
    <script type="text/javascript" src="~/lib/css/plugins/jquery-validation/js/additional-methods.min.js"></script>
    <script type="text/javascript" src="~/lib/css/plugins/select2/select2.min.js"></script>
    <script type="text/javascript" src="~/lib/css/plugins/jquery.form.js"></script>
    <script type="text/javascript" src="~/scripts/news.js"></script>

    <script>
        jQuery(document).ready(function() {
            Metronic.init(); // init metronic core componets
            Layout.init(); // init layout
            newsCreate.init();

            $(".page-sidebar-menu li:nth-child(3) .title").after("<span class='selected'></span>");
            $(".page-sidebar-menu li:nth-child(3) .arrow").addClass("open");
            $(".page-sidebar-menu li:nth-child(3)").addClass("active open");
            $(".page-sidebar-menu li:nth-child(3) .sub-menu li:nth-child(2)").addClass("active");
        });
    </script>
}